{include file="common/head"}
<head>
    <title>费用查询</title>
    <link rel="stylesheet" href="/static/flatpickr/flatpickr.min.css">
    <script src="/static/flatpickr/flatpickr.min.js"></script>
<style type="text/css">
    input{display:initial!important;}
</style>    
</head>
<body >

    <div class="container-fluid " >

    <div class="row">
        <div class="col-2" style="text-align: left;line-height: 50px;font-size: 2rem;" >
            收付款查询
        </div>
        <div class="col-10">
            <form action="/index.php/customer/fee_log" method="post">
                <div class="row" id="query_bar" style="height: 50px;line-height: 50px;">
                    <div class="col">

                    <label for="dept_id">类型：</label>  
                    <select name="dept_id" class="form-control" style="display:initial!important;width: 140px;">
                      <option value="all" {if $dept_id=='all'} selected {/if}>所有驾校</option>
                      {foreach $school as $kv}
                        <option value="{$kv['id']}" {if $dept_id==$kv['id']} selected {/if}>{$kv['name']}</option>
                      {/foreach}
                    </select>

                    <label for="type">类型：</label>  
                    <select name="type" class="form-control" style="display:initial!important;width: 140px;">
                      <option value="1,2,3,4,5,6" {if $type=='all'}selected{/if}>所有类型</option>
                      <option value="1" {if $type==1}selected{/if}>学费</option>
                      <option value="2" {if $type==2}selected{/if}>补考费</option>
                      <option value="3" {if $type==3}selected{/if}>退款</option>
                      <option value="4" {if $type==4}selected{/if}>推广费</option>
                    </select>

                    <label for="name" >姓名：</label>
                    <input class="form-control" type="text"  id="name" name="name" value="{$name}" placeholder="姓名" />
                    <label for="mobile" >手机：</label>
                    <input class="form-control" type="text"  id="mobile" name="mobile" value="{$mobile}" placeholder="手机号码" />

                    <label for="order_no" >
                        <input class="form-control" type="text" value="{$sdate}" id="sdate" name="sdate" placeholder="开始日期" />
                    </label>

                    <label for="sdate" >
                        <input class="form-control" type="text" value="{$edate}" id="edate" name="edate" placeholder="结束日期" />
                    </label>   

                    <button type="button" class="btn btn-warning query" style="vertical-align: middle;" >
                        <span class="bi-search" ></span>
                    </button>            
                
                    </div>

                </div>
            </form>
        </div>
    </div>

      <table class="table table-sm table-striped">
        <thead>
          <th>序号</th>
          <th>会员</th>
          <th>类型</th>
          <th>金额</th>
          <th>备注</th>
          <th>操作人</th>
          <th>日期</th>
          <th>
<!--             <button type="button" class="btn btn btn-primary">
                <a href="/index.php/customer/charge" alt="充值"><span class="bi-cash" style="color:white;">充值</span></a>
            </button> -->
          </th>
        </thead>
        <tbody>
          {foreach $list['data'] as $k=>$log}
          <tr>
            <td>{$k+1}</td>
            <td>{$log['customer_id_name']}</td>
            <td>{$log['type_name']}</td>
            <td style="color:{if $log['money']<0} red;{/if}">{$log['money']}</td>
            <td>{$log['memo']}</td>
            <td>{$log['creater']}</td>
            <td>{$log['create_time']}</td>
            <td></td>
          </tr>
          {/foreach}
        </tbody>
      </table>
    {include file="common/pagination"}
    </div>

<script type="text/javascript">


  $(document).ready(function(){

    flatpickr("#sdate", {});
    flatpickr("#edate", {});

    $(".sdate").flatpickr({
        enableTime: true,
        dateFormat: "Y-m-d H:i:s",
    });
    $(".edate").flatpickr({
        enableTime: true,
        dateFormat: "Y-m-d H:i",
    });

    $(".query").on('click',function(){
        var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2

        $("form").submit();
        layer.close(index);
    })    
  })


  




</script>


</body>
</html>
